package com.management.department.teacherinfosystem.Repository;

import com.management.department.teacherinfosystem.Entity.AcademicAchievementAuthor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AcademicAchievementAuthorRepository extends JpaRepository<AcademicAchievementAuthor, Long> {
    
    // 根据学术成果ID查询作者
    List<AcademicAchievementAuthor> findByAchievementId(Long achievementId);
    
    // 根据工号查询
    List<AcademicAchievementAuthor> findByStaffNo(String staffNo);
    
    // 根据是否本单位查询
    List<AcademicAchievementAuthor> findByIsCurrentUnit(Boolean isCurrentUnit);
    
    // 根据作者署名顺序查询
    List<AcademicAchievementAuthor> findByAuthorOrder(String authorOrder);
    
    // 根据学术成果ID删除作者
    void deleteByAchievementId(Long achievementId);
    
    // 根据作者姓名模糊查询
    List<AcademicAchievementAuthor> findByAuthorNameContaining(String authorName);
}
